Integrand size = 30, antiderivative size = 61 \[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=\frac {a c^2 \text {arctanh}(\sin (e+f x))}{2 f}-\frac {a c^2 \sec (e+f x) \tan (e+f x)}{2 f}+\frac {a c^2 \tan ^3(e+f x)}{3 f} \]
Leaf count is larger than twice the leaf count of optimal. \(132\) vs. \(2(61)=122\).
Time = 0.57 (sec) , antiderivative size = 132, normalized size of antiderivative = 2.16 \[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=\frac {a c^{3/2} \left (-6 \arcsin \left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {2} \sqrt {c}}\right ) \sqrt {c-c \sec (e+f x)}+\sqrt {c} \sqrt {1+\sec (e+f x)} \left (2+\sec (e+f x)-5 \sec ^2(e+f x)+2 \sec ^3(e+f x)\right )\right ) \tan (e+f x)}{6 f (-1+\sec (e+f x)) \sqrt {1+\sec (e+f x)}} \]
(a*c^(3/2)*(-6*ArcSin[Sqrt[c - c*Sec[e + f*x]]/(Sqrt[2]*Sqrt[c])]*Sqrt[c - c*Sec[e + f*x]] + Sqrt[c]*Sqrt[1 + Sec[e + f*x]]*(2 + Sec[e + f*x] - 5*Se c[e + f*x]^2 + 2*Sec[e + f*x]^3))*Tan[e + f*x])/(6*f*(-1 + Sec[e + f*x])*S qrt[1 + Sec[e + f*x]])
Time = 0.30 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.92, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3042, 4446, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec (e+f x) (a \sec (e+f x)+a) (c-c \sec (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right ) \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2dx\) |
\(\Big \downarrow \) 4446 |
\(\displaystyle -a c \int \left (c \sec (e+f x) \tan ^2(e+f x)-c \sec ^2(e+f x) \tan ^2(e+f x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -a c \left (-\frac {c \text {arctanh}(\sin (e+f x))}{2 f}-\frac {c \tan ^3(e+f x)}{3 f}+\frac {c \tan (e+f x) \sec (e+f x)}{2 f}\right )\) |
-(a*c*(-1/2*(c*ArcTanh[Sin[e + f*x]])/f + (c*Sec[e + f*x]*Tan[e + f*x])/(2 *f) - (c*Tan[e + f*x]^3)/(3*f)))
3.1.3.3.1 Defintions of rubi rules used
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(c sc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Simp[((-a)*c)^m Int[ExpandTrig[csc[e + f*x]*cot[e + f*x]^(2*m), (c + d*csc[e + f*x])^(n - m ), x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && EqQ[b*c + a*d, 0] && Eq Q[a^2 - b^2, 0] && IntegersQ[m, n] && GeQ[n - m, 0] && GtQ[m*n, 0]
Time = 4.15 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.61
method | result | size |
derivativedivides | \(\frac {-a \,c^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-a \,c^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a \,c^{2} \tan \left (f x +e \right )+a \,c^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\) | \(98\) |
default | \(\frac {-a \,c^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-a \,c^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a \,c^{2} \tan \left (f x +e \right )+a \,c^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\) | \(98\) |
risch | \(\frac {i a \,c^{2} \left (3 \,{\mathrm e}^{5 i \left (f x +e \right )}-6 \,{\mathrm e}^{4 i \left (f x +e \right )}-3 \,{\mathrm e}^{i \left (f x +e \right )}-2\right )}{3 f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )^{3}}+\frac {a \,c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{2 f}-\frac {a \,c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{2 f}\) | \(104\) |
parts | \(\frac {a \,c^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}-\frac {a \,c^{2} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}-\frac {a \,c^{2} \tan \left (f x +e \right )}{f}-\frac {a \,c^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )}{f}\) | \(106\) |
norman | \(\frac {\frac {a \,c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {8 a \,c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}-\frac {a \,c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}-\frac {a \,c^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2 f}+\frac {a \,c^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2 f}\) | \(118\) |
parallelrisch | \(-\frac {a \,c^{2} \left (\frac {3 \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2}+\frac {3 \left (-\cos \left (3 f x +3 e \right )-3 \cos \left (f x +e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2}+\sin \left (3 f x +3 e \right )-3 \sin \left (f x +e \right )+3 \sin \left (2 f x +2 e \right )\right )}{3 f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) | \(125\) |
1/f*(-a*c^2*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)-a*c^2*(1/2*sec(f*x+e)*tan(f *x+e)+1/2*ln(sec(f*x+e)+tan(f*x+e)))-a*c^2*tan(f*x+e)+a*c^2*ln(sec(f*x+e)+ tan(f*x+e)))
Time = 0.27 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.69 \[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=\frac {3 \, a c^{2} \cos \left (f x + e\right )^{3} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, a c^{2} \cos \left (f x + e\right )^{3} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (2 \, a c^{2} \cos \left (f x + e\right )^{2} + 3 \, a c^{2} \cos \left (f x + e\right ) - 2 \, a c^{2}\right )} \sin \left (f x + e\right )}{12 \, f \cos \left (f x + e\right )^{3}} \]
1/12*(3*a*c^2*cos(f*x + e)^3*log(sin(f*x + e) + 1) - 3*a*c^2*cos(f*x + e)^ 3*log(-sin(f*x + e) + 1) - 2*(2*a*c^2*cos(f*x + e)^2 + 3*a*c^2*cos(f*x + e ) - 2*a*c^2)*sin(f*x + e))/(f*cos(f*x + e)^3)
\[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=a c^{2} \left (\int \sec {\left (e + f x \right )}\, dx + \int \left (- \sec ^{2}{\left (e + f x \right )}\right )\, dx + \int \left (- \sec ^{3}{\left (e + f x \right )}\right )\, dx + \int \sec ^{4}{\left (e + f x \right )}\, dx\right ) \]
a*c**2*(Integral(sec(e + f*x), x) + Integral(-sec(e + f*x)**2, x) + Integr al(-sec(e + f*x)**3, x) + Integral(sec(e + f*x)**4, x))
Time = 0.21 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.77 \[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=\frac {4 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a c^{2} + 3 \, a c^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 12 \, a c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) - 12 \, a c^{2} \tan \left (f x + e\right )}{12 \, f} \]
1/12*(4*(tan(f*x + e)^3 + 3*tan(f*x + e))*a*c^2 + 3*a*c^2*(2*sin(f*x + e)/ (sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) + 12 *a*c^2*log(sec(f*x + e) + tan(f*x + e)) - 12*a*c^2*tan(f*x + e))/f
Leaf count of result is larger than twice the leaf count of optimal. 111 vs. \(2 (55) = 110\).
Time = 0.31 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.82 \[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=\frac {3 \, a c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 3 \, a c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (3 \, a c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 8 \, a c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3 \, a c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{3}}}{6 \, f} \]
1/6*(3*a*c^2*log(abs(tan(1/2*f*x + 1/2*e) + 1)) - 3*a*c^2*log(abs(tan(1/2* f*x + 1/2*e) - 1)) - 2*(3*a*c^2*tan(1/2*f*x + 1/2*e)^5 + 8*a*c^2*tan(1/2*f *x + 1/2*e)^3 - 3*a*c^2*tan(1/2*f*x + 1/2*e))/(tan(1/2*f*x + 1/2*e)^2 - 1) ^3)/f
Time = 15.64 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.87 \[ \int \sec (e+f x) (a+a \sec (e+f x)) (c-c \sec (e+f x))^2 \, dx=\frac {a\,c^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f}-\frac {a\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\frac {8\,a\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{3}-a\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \]